package com.chagee.store.operation.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 单据类型
 */
@Getter
@AllArgsConstructor
public enum OrderStatusEnum {
	THREE_PARTY_CLOSING(0, "三方打烊"),
	OPEN_EARLY(1, "开早"),
	SELF_CLOSING(2, "自打烊"),
	;
	private final Integer type;
	private final String desc;

	public static OrderStatusEnum getByType(Integer type) {
		for (OrderStatusEnum value : values()) {
			if (Objects.equals(value.getType(), type)) {
				return value;
			}
		}
		return null;
	}
}
